<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-','%')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('管理')"></div>
        <div th:replace="common/search::search('%add%kaika%import')"></div>
    </div>
</div>

<!--添加Card模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="cardtype">
                                                        <option value="">请选择</option>
                                                        <option value="1">电话卡</option>
                                                        <option value="2">积分卡</option>
                                                        <option value="3">礼品卡</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="cardno"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">面值</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="amount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效方式</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="sxtype">
                                                        <option value="">请选择</option>
                                                        <option value="1">绑定生效</option>
                                                        <option value="2">默认生效</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="startdate" name="startdate">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">失效日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="enddate" name="enddate">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡密</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="pwd"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">渠道</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="qudoa"
                                                           type="text" maxlength="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">启用状态</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否已用</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isUsed" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">使用者</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="useby"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Card模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="cardtype" id="cardtype">
                                                        <option value="">请选择</option>
                                                        <option value="1">电话卡</option>
                                                        <option value="2">积分卡</option>
                                                        <option value="3">礼品卡</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="cardno" name="cardno"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">面值</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="amount" name="amount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效方式</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="sxtype" id="sxtype">
                                                        <option value="">请选择</option>
                                                        <option value="1">绑定生效</option>
                                                        <option value="2">默认生效</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效日期</label>
                                                <div class="col-sm-8">
                                                    <input type="text" class="form-control selectData" readonly
                                                           id="startdate2" name="startdate">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">失效日期</label>
                                                <div class="col-sm-8">
                                                    <input type="text" class="form-control selectData" readonly
                                                           id="enddate2" name="enddate">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">卡密</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="pwd" name="pwd"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">渠道</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="qudoa" name="qudoa"
                                                           type="text" maxlength="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">启用状态</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否已用</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isUsed" name="isUsed" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">使用者</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="useby" name="useby"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">领取者</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="uid" name="uid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--开卡模态框-->
<div id="kaika-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <form id="kform" method="post" class="form-horizontal" action="kaika" target="_blank">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">开卡张数</label>
                                <div class="col-sm-10">
                                    <input class="form-control" id="num" name="num" type="text" maxlength="50"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">有效期(天)</label>
                                <div class="col-sm-10">
                                    <input class="form-control" name="expire" type="number" value="90" maxlength="50"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">目标应用</label>
                                <div class="col-sm-10">
                                    <select class="form-control select2" id="targetmpid" name="targetmpid">
                                        <option th:each="c:${mapps}" th:value="${c.id}" th:text="${c.name}"></option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 20px">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">保存内容</button>
                            <button data-toggle="modal" type="button" class="btn btn-white" href="#kaika-form">取消
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!--导入电话卡模态框-->
<div id="import-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <form id="imform" method="post" class="form-horizontal" action="impexcel">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">目标应用</label>
                                <div class="col-sm-10">
                                    <select class="form-control select2"name="targetmpid">
                                        <option th:each="c:${mapps}" th:value="${c.id}" th:text="${c.name}"></option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 20px">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">保存内容</button>
                            <button data-toggle="modal" type="button" class="btn btn-white" href="#kaika-form">取消
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/card.js"></script>
</body>
</html>
